<app-back-btn></app-back-btn>
<div class="page-title">
  <span class="title" *ngIf="!this.code">添加TestRecord</span>
  <span class="title" *ngIf="this.code">修改TestRecord</span>
</div>

<div class="panel panel-body">
  <form nz-form [formGroup]="validateForm" class="form-wrap" (submit)="addTestRecord($event)">
    <h2 class="subtitle">TestRecord信息</h2>

    <!--factoryCode start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="factoryCode" nzRequired> 工厂编码</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('factoryCode')">
        <input nz-input formControlName="factoryCode" type="text" id="factoryCode" placeholder="工厂编码">
        <nz-form-explain *ngIf="getFormControl('factoryCode').dirty&&getFormControl('factoryCode').errors">
          <ng-container *ngIf="getFormControl('factoryCode').hasError('required')">请输入工厂编码</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        工厂编码
      </nz-form-control>
    </nz-form-item>

    <!--staffCode start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="staffCode" nzRequired> 员工编码</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('staffCode')">
        <input nz-input formControlName="staffCode" type="text" id="staffCode" placeholder="员工编码">
        <nz-form-explain *ngIf="getFormControl('staffCode').dirty&&getFormControl('staffCode').errors">
          <ng-container *ngIf="getFormControl('staffCode').hasError('required')">请输入员工编码</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        员工编码
      </nz-form-control>
    </nz-form-item>

    <!--jobNumber start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="jobNumber" nzRequired> 工号</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('jobNumber')">
        <input nz-input formControlName="jobNumber" type="text" id="jobNumber" placeholder="工号">
        <nz-form-explain *ngIf="getFormControl('jobNumber').dirty&&getFormControl('jobNumber').errors">
          <ng-container *ngIf="getFormControl('jobNumber').hasError('required')">请输入工号</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        工号
      </nz-form-control>
    </nz-form-item>

    <!--testUnitCode start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="testUnitCode" nzRequired>测试件编</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('testUnitCode')">
        <input nz-input formControlName="testUnitCode" type="text" id="testUnitCode" placeholder="测试件编码">
        <nz-form-explain *ngIf="getFormControl('testUnitCode').dirty&&getFormControl('testUnitCode').errors">
          <ng-container *ngIf="getFormControl('testUnitCode').hasError('required')">请输入测试件编码</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        测试件编码
      </nz-form-control>
    </nz-form-item>

    <!--testOptionCode start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="testOptionCode" nzRequired>测试项编</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('testOptionCode')">
        <input nz-input formControlName="testOptionCode" type="text" id="testOptionCode" placeholder="测试项编码">
        <nz-form-explain *ngIf="getFormControl('testOptionCode').dirty&&getFormControl('testOptionCode').errors">
          <ng-container *ngIf="getFormControl('testOptionCode').hasError('required')">请输入测试项编码</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        测试项编码
      </nz-form-control>
    </nz-form-item>

    <!--staffName start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="staffName" nzRequired> 员工姓名</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('staffName')">
        <input nz-input formControlName="staffName" type="text" id="staffName" placeholder="员工姓名">
        <nz-form-explain *ngIf="getFormControl('staffName').dirty&&getFormControl('staffName').errors">
          <ng-container *ngIf="getFormControl('staffName').hasError('required')">请输入员工姓名</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        员工姓名
      </nz-form-control>
    </nz-form-item>

    <!--factorySn start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="factorySn" nzRequired>工厂sn</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('factorySn')">
        <input nz-input formControlName="factorySn" type="text" id="factorySn" placeholder="工厂sn码">
        <nz-form-explain *ngIf="getFormControl('factorySn').dirty&&getFormControl('factorySn').errors">
          <ng-container *ngIf="getFormControl('factorySn').hasError('required')">请输入工厂sn码</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        工厂sn码
      </nz-form-control>
    </nz-form-item>

    <!--testOption start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="testOption" nzRequired> 测试项</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('testOption')">
        <input nz-input formControlName="testOption" type="text" id="testOption" placeholder="测试项">
        <nz-form-explain *ngIf="getFormControl('testOption').dirty&&getFormControl('testOption').errors">
          <ng-container *ngIf="getFormControl('testOption').hasError('required')">请输入测试项</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        测试项
      </nz-form-control>
    </nz-form-item>

    <!--表单底部start-->
    <nz-form-item class="action-button">
      <nz-form-control class="text-center">
        <button nz-button nzSize="large" [nzType]="'primary'" class="pl-30 pr-30" [nzLoading]="isConfirmLoading">
          {{'Btn0009'| translate}}
        </button>
      </nz-form-control>
    </nz-form-item>
    <!--表单底部end-->
  </form>

</div>
